﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CLIENT_EMR.Doctor_Bll.Patient_Action_Manager;

namespace CLIENT_EMR.Doctor_Bll
{
    public partial class frmAddPatientShow : Form
    {
        private Point ptMouseCurrrnetPos, ptMouseNewPos,
       ptFormPos, ptFormNewPos;
        private bool blnMouseDown = false;
        private frmMain pParent;

        public frmAddPatientShow()
        {
            InitializeComponent();
            //pParent = pMain;
        }

        private void frmAddPatientShow_Load(object sender, EventArgs e)
        {
            // Init window size and position
            this.Top = 100;
            this.Left = Screen.PrimaryScreen.Bounds.Width - 100;
            this.Width = 80;
            this.Height = 80;
        }

        private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
        {
            if (blnMouseDown)
            {
                //Get the current position of the mouse in the screen
                ptMouseNewPos = Control.MousePosition;

                //Set window position
                ptFormNewPos.X = ptMouseNewPos.X - ptMouseCurrrnetPos.X + ptFormPos.X;
                ptFormNewPos.Y = ptMouseNewPos.Y - ptMouseCurrrnetPos.Y + ptFormPos.Y;

                //Save window position
                Location = ptFormNewPos;
                ptFormPos = ptFormNewPos;

                //Save mouse position
                ptMouseCurrrnetPos = ptMouseNewPos;
            }      
        }

        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                blnMouseDown = true;

                // Save window position and mouse position
                ptMouseCurrrnetPos = Control.MousePosition;
                ptFormPos = Location;
            }
        }

        private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
                //Return back signal
                blnMouseDown = false;
        }

        private void pictureBox1_DoubleClick(object sender, EventArgs e)
        {
            frmPatientIN_Old fc = new frmPatientIN_Old("");
            fc.TopMost = true;
            fc.ShowDialog();
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
        
        }

        private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
        {
           
        }
    }
}
